#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
from Shopping.conf import config

def file_db_handler(conn_params):
    '''
    返回数据库路径
    :param conn_params:  数据库配置信息
    :return:
    '''
    db_path = os.path.join(conn_params['path'], conn_params['name'])
    return db_path

def db_handler():
    '''
    返回数据库路径(连接信息)
    :return:
    '''
    conn_params = config.DATABASE
    if conn_params['engine'] == 'file_storage':
        return file_db_handler(conn_params)
    elif conn_params['engine'] == 'mysql':
        pass